package printer;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author oldliu
 * @since 1.0
 */
public class Test3Printer {
    public static void main(String[] args) {
        //自动装配,按照名称
        ApplicationContext ac=new ClassPathXmlApplicationContext("bean2.xml");
        Printer printer = ac.getBean("printer3", Printer.class);
        printer.print("hello world");
    }
}
